﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Bussiness;
using Model.Entities;

namespace WebApp
{
    public partial class ShopRegister : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache); 
        }

        protected void BtnOK_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.txtName.Value.Trim()))
                throw new Exception("商家名称不能为空! ");
            ShopsInfo si = new ShopsInfo()
            {
                ShopName = this.txtName.Value.Trim(),
                Address = this.txtAddress.Value.Trim(),
                PersonInCharge = this.txtPerson.Value.Trim(),
                CreateTime = DateTime.Now,
                ContractID = "0",
                Aviable = 1,
                Phone = this.txtPhone.Value.Trim()

            };
            ShopOperation.Instance.Insert(si);

        }
    }
}